package com.dropTables.TakingNote;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.TabActivity;
import android.widget.TabHost;
import android.content.res.Resources;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;


public class TakingNote extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
        // Check to see if user has logged in before
        HttpComm.readLoginInfo();
        try
        {
	        AlarmManager alarmManager = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
			Intent intent = new Intent(this, GeneralService.class);
			PendingIntent pendingIntent = PendingIntent.getService(this,0,intent,0);
			alarmManager.set(AlarmManager.RTC,System.currentTimeMillis(),pendingIntent);
        }
        catch(Exception e)
        {
        	System.out.println(e.toString());
        }
       
        finish();
        if (HttpComm.isLoggedIn())
        {
        	Intent intent = new Intent().setClass(this, NormalNoteActivity.class);
        	startActivity(intent);
        }
        else
        {
	        Intent intent = new Intent().setClass(this, LoginActivity.class);
	        startActivity(intent);
        }       
    }
}
